//
//  TeamHeroCell.m
//  LOL_JewelBox
//
//  Created by dllo on 15/4/29.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "TeamHeroCell.h"

@implementation TeamHeroCell

- (void)dealloc
{
    
    [_imageHero release];
    [_desHero release];
    [super dealloc];
    
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {

        self.imageHero = [[UIImageView alloc] init];
        [self.contentView addSubview:self.imageHero];
        [_imageHero release];
        
        // 各英雄简介
        self.desHero = [[UILabel alloc] init];
        [self.contentView addSubview:self.desHero];
        [_desHero release];
        
    }
    return  self;
}


- (void)layoutSubviews
{
    
    // 头像坐标
    self.imageHero.frame = CGRectMake(10, 10, 64, 64);
    
    // 简介坐标
    NSDictionary *dic = [NSDictionary dictionaryWithObjectsAndKeys:[UIFont systemFontOfSize:16],NSFontAttributeName, nil];
    // 根据文本大小(font)计算出文本的rect值,最大范围不超过(375,400);
    // 第三个属性是根据什么属性来定义高度
    CGRect rect = [self.desHero.text boundingRectWithSize:CGSizeMake(355, 5000) options:NSStringDrawingUsesLineFragmentOrigin attributes:dic context:nil];
    self.desHero.frame = CGRectMake(10, 84, CONTENTWIDTH - 20,rect.size.height);
    
    
}


@end
